﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Text;

namespace Sautom.WcfServer.Security
{
    class Principal : IPrincipal
    {
        private static Principal _principalInstance;
        public static Principal PrincipalInstance
        {
            get
            {
                return _principalInstance;
            }
            set
            {
                _principalInstance = value;
            }
        }

        public Principal(string userName)
        {
            _identity = new Identity(userName);
        }

        #region Implementation of IPrincipal

        public bool IsInRole(string role)
        {
            throw new NotImplementedException();
        }

        private readonly IIdentity _identity;
        public IIdentity Identity
        {
            get { return _identity; }
        }

        #endregion
    }

    class Identity : IIdentity
    {
        private readonly string _name;

        public Identity(string name)
        {
            _name = name;
        }

        #region Implementation of IIdentity

        public string Name
        {
            get { return _name; }
        }

        public string AuthenticationType
        {
            get { throw new NotImplementedException(); }
        }

        public bool IsAuthenticated
        {
            get { throw new NotImplementedException(); }
        }

        #endregion
    }
}
